package com.sponsorpay.sdk.android.utils;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class SponsorPayParametersProvider
{
  private static SponsorPayParametersProvider INSTANCE = new SponsorPayParametersProvider();
  private Set<SPParametersProvider> providers = new HashSet();

  private boolean addNewProvider(SPParametersProvider paramSPParametersProvider)
  {
    return this.providers.add(paramSPParametersProvider);
  }

  public static boolean addParametersProvider(SPParametersProvider paramSPParametersProvider)
  {
    synchronized (INSTANCE)
    {
      boolean bool = INSTANCE.addNewProvider(paramSPParametersProvider);
      return bool;
    }
  }

  public static Map<String, String> getParameters()
  {
    while (true)
    {
      HashMap localHashMap;
      Iterator localIterator;
      synchronized (INSTANCE)
      {
        Set localSet = INSTANCE.getProviders();
        if (localSet.size() == 0)
        {
          Map localMap = Collections.emptyMap();
          return localMap;
        }
        localHashMap = new HashMap();
        localIterator = localSet.iterator();
        if (!localIterator.hasNext())
          return localHashMap;
      }
      localHashMap.putAll(((SPParametersProvider)localIterator.next()).getParameters());
    }
  }

  private Set<SPParametersProvider> getProviders()
  {
    return this.providers;
  }

  public static boolean removeParametersProvider(SPParametersProvider paramSPParametersProvider)
  {
    synchronized (INSTANCE)
    {
      boolean bool = INSTANCE.removeProvider(paramSPParametersProvider);
      return bool;
    }
  }

  private boolean removeProvider(SPParametersProvider paramSPParametersProvider)
  {
    return this.providers.remove(paramSPParametersProvider);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.sponsorpay.sdk.android.utils.SponsorPayParametersProvider
 * JD-Core Version:    0.6.2
 */